package auth

import (
	"golang.org/x/crypto/bcrypt"
)

func ValidatePassword(pssword string, password any) bool {
	return nil == bcrypt.CompareHashAndPassword([]byte(password.(string)), []byte(pssword))

}

func HashPassword(str string, salt ...string) string {
	password, err := bcrypt.GenerateFromPassword([]byte(str), bcrypt.DefaultCost)
	if err != nil {
		return ""
	}
	return string(password)
}
